package com.example.lifecycle;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.lifecycle.base.BaseTabFragment;
import com.example.lifecycle.main.MainContract;
import com.example.lifecycle.utils.ToastUtils;

import javax.inject.Inject;

public class HomeFragment extends BaseTabFragment implements MainContract.View {

    private MainContract.Presenter presenter;

    public HomeFragment() {
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_home, container, false);
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        getLifecycle().addObserver(new TestListener());

        presenter.load();
    }

    @Override
    public void onShow() {
        System.out.println("#### " + getClass().getSimpleName() + "  onShow  ");
    }

    @Override
    public void setPresenter(MainContract.Presenter presenter) {
        this.presenter = presenter;
    }
}
